FROM node:16.18 AS build
WORKDIR /src
COPY package.json package.json
RUN npm install
COPY . .
RUN npm run build:prod

FROM nginx:latest AS base
EXPOSE 80
COPY --from=build /src/dist /usr/share/nginx/html
CMD ["nginx","-g","daemon off;"]
